const Service = require( 'egg' ).Service;

class home extends Service {

    async demo( body ) {
        const { ctx, app } = this
        console.log( app );
        let sql = ''
        // const result = await app.mysql.update('myEgg',{id:7,name:'汪汪汪'});
        const result = await app.mysql.query( 'select * from myEgg where id=7' );
        // let result='99999999999999'
        return result;
    }
    async getDataList( body ) {
        const { ctx, app } = this
        let result = {
            data:body,
            code:200,
        }
        // 增
        // let result = await app.mysql.insert('myegg',body)
        // 删
        // let result = await app.mysql.delete( 'myegg', { id: 1 } )
        // 改
        // let result = await app.mysql.uodate('myegg',body)
        // 查
        // let result = await app.mysql.get('myegg',body)

        return result
    }

}

module.exports = home;
